package chainOfResponsibilityPattern

/**
 * 责任节点抽象
 */
abstract class Handler {
    private var next: Handler? = null
    abstract fun handleRequest()

    //获取下一个责任节点
    fun getNext(): Handler? {
        return next
    }

    //设置下一个责任节点
    fun setNext(next: Handler) {
        this.next = next
    }
}